﻿//高德服务
function GaodeMapService(layerInfo) {
    var GaodeMapService = new Object;
    GaodeMapService.id = layerInfo.hasOwnProperty("GUID") ? layerInfo.GUID : "";
    GaodeMapService.url = layerInfo.hasOwnProperty("URL") ? layerInfo.URL : "";
    GaodeMapService.name = layerInfo.hasOwnProperty("NAME") ? layerInfo.NAME : "";
    GaodeMapService.servertype = layerInfo.hasOwnProperty("SERVERTYPE") ? layerInfo.SERVERTYPE : "";
    GaodeMapService.CreateLayer = function () {
        var id = this.id;
        var url = this.url;
        var name = this.name;
        var servertype = this.servertype;
        var thisLayer = new ol.layer.Tile({
            source: new ol.source.XYZ({
                url: url,
                id: id,
                wrapX: false
            }),
            name: name
        });
        return thisLayer;
    }
    return GaodeMapService;
}